package struts.action;

import javax.servlet.http.HttpServletRequest;

import annotation.ActionConfig;
import annotation.ActionConfigBean;

import struts.Action;
import struts.form.ActionForm;
import struts.form.TestForm;

@ActionConfig(action=TestAction.class,form=TestForm.class,path="/test",forwards={"chenggong,/view/chenggong.jsp","shibai,/view/shibai.jsp"})
public class TestAction implements Action {

	public String execute(HttpServletRequest request, ActionForm form,ActionConfigBean config) {
		TestForm testForm=(TestForm)form;
		String url="shibai";
		if("1".equals(testForm.getName())){
			url="chenggong";
		}
		return config.getUrl(url);
	}
}
